HEADERS		= $(wildcard *.h)
SOURCES		= $(wildcard *.c)
OBJECTS		= $(SOURCES:%.c=%.o)

TARGET		= $(notdir $(CURDIR)).a

MEGA_ROOT			= ../..
include $(MEGA_ROOT)/Rules.make

CFLAGS				= -Wall -O2 -I $(MEGA_ROOT)/include 

all: $(TARGET)

$(TARGET): $(OBJECTS)
	ar r $@ $^

$(OBJECTS): %.o: %.c $(HEADERS)
	$(CC) $(CFLAGS) -c $< -o $@

clean:
	rm -rf $(TARGET) $(OBJECTS)
